<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePayLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pay_logs', function (Blueprint $table) {
            $table->id();
            $table->string('order_sn')->nullable()->comment('订单编号');
            $table->decimal('real_pay',10,2)->default(0.00)->comment('实际支付金额');
            $table->tinyInteger('status')->default(0)->comment('支付状态 1:用户下单付款，2:微信核验成功，4:微信退款');
            $table->string('pay_type')->default('mini')->comment('支付类型');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `pay_logs` comment '付款记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pay_logs');
    }
}
